<template>
  <el-row id="main" >
    <el-col  style="border-radius:3px;background-color:rgba(255,255,255,0.8)" span="16" offset="3">
      <div v-if="data==null">
        <div class="p-tb20 text-center">{{PRO_CONSTANT.IS_LOADING_EMPTY}}</div>
      </div>
      <div v-else class="p-15">
        <div class="p-tb10 text-center border-b">
          <h4>{{data.title}}</h4>
          <!--<div class="title12 text-right">{{data.createTime}}</div>-->
        </div>
        <div class="p-tb10"></div>
        <div class="overflow-y" :style="{'max-height':slide_h+'px'}">
          <pre v-html="data.content"></pre>
        </div>
        <div class="p-tb10"></div>
      </div>
    </el-col>
  </el-row>
</template>
<script>
  export default {
    inject:["changeActive"],
    data() {
      return {
        slide_h: (window.document.body.offsetHeight -300),
        agentApplyInfo:null,
        data: "",
      }
    },
    methods: {
      init(id) {
        this.$store.commit("saveLoadingMap", {
          "target": this.proAPI.URLS.getInformationById,
          lock: 1
        });
        this.proAPI.getJson(this.proAPI.URLS.getInformationById,{id:id}).then((res) => {
          this.data = res.data;
          this.navinfo.title = res.data.title;
        }).catch(()=>{
        })
      },
      setDialoginfo(data){
        this.changeActive(3);
        this.$nextTick(() => {
          this.init(data.id);
        })
      },
    },
    beforeCreate: function () {
    },
    created: function () {
    },
    beforeMount: function () {
    },
    mounted: function () {
    },
    beforeUpdate: function () {
    },
    updated: function () {
    },
    activated: function () {
    },
    deactivated: function () {
    },
    beforeDestroy: function () {
    },
    destroyed: function () {
    },
    errorCaptured: function (err, vm, info) {
    },
    beforeRouteEnter(to,from,next){
      if(to.query.id){
        next(vm =>vm.setDialoginfo(to.query));
      }else{
          next("/home");
      }
    }
  }
</script>
<style scoped>
</style>
